package com.haoze.nurse.dao;

import com.haoze.nurse.dto.itinerary.ItineraryDTO;
import com.haoze.nurse.dto.OrderPageDto;
import com.haoze.nurse.model.AtomizeMedReturnEntity;
import com.haoze.nurse.model.PrintMarkEntity;
import com.haoze.nurse.vo.OrderDetailByOrderNoVo;
import com.haoze.nurse.vo.OrderInfoByInpatNoVo;
import com.haoze.nurse.vo.OrderTaskInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderMapper {

	List<OrderInfoByInpatNoVo> queryOrderList(OrderPageDto pageDto);

	/**
	 * 查询子医嘱
	 * @param inpatNum
	 * @param orderNo
	 * @return
	 */
	List<OrderInfoByInpatNoVo> querySubOrderList(@Param("inpatNum") String inpatNum, @Param("orderNo") String orderNo);

	/**
	 * 获取医嘱，关键节点（有子节点）的详细信息
	 * @param patOrdersId
	 * @return
	 */
	List<OrderTaskInfo> queryOrderTaskKey(String patOrdersId);

	List<OrderDetailByOrderNoVo> selectOrderDetail(String inpatorderdataId, String startDate, String endDate);

	List<ItineraryDTO> selectItinerary(@Param("inpatList") List<String> inpatList,@Param("administrationList") List<String> administrationList,
									   @Param("isTreatment") boolean isTreatment, @Param("executeTime") Date executeTime, @Param("print") String print);

	List<Map<String,String>> selectOrderExecuteTime(@Param("nodeId") String[] nodeId,@Param("date") String date,@Param("orderList") List<String> orderList);

	void insertPrintList(@Param("list") List<PrintMarkEntity> list);

	List<Map<String,String>> selectTreatment(@Param("orderType") String orderType,@Param("date") String date,
									   @Param("inpatNum") String inpatNum);

	List<Map<String,String>> selectTreatmentPrint(@Param("orderType") String orderType,@Param("date") String date,
										   @Param("datetime") String datetime, @Param("inpatNum") String inpatNum, @Param("wardDeptId") String wardDeptId);

	List<Map<String,String>> selectTreatmentPrintDate(@Param("orderType") String orderType,@Param("date") String date,
												  @Param("datetime") String datetime, @Param("inpatNum") String inpatNum, @Param("wardDeptId") String wardDeptId);


	List<Map<String,String>> selectTreatmentDifferent(@Param("orderType") String orderType,@Param("date") String date,
										   @Param("inpatNum") String inpatNum, @Param("wardDeptId") String wardDeptId);

	List<Map<String,String>> selectTransfer(@Param("inpatNum") String inpatNum);
	List<Map<String,String>> selectTransfer1(@Param("inpatNums") String inpatNums);
	List<Map<String,String>> selectTransfer2(@Param("inpatNums") String inpatNums,@Param("deptId") String deptId);

	List<Map<String,String>> selectPrintItemDate(@Param("type") String type,@Param("itemClassId") String itemClassId,@Param("inpatNum") String inpatNum,@Param("startTime") String startTime,@Param("endTime") String endTime);
	List<Map<String,String>> selectPrintItemDate1(@Param("type") String type,@Param("itemClassId") String itemClassId,@Param("inpatNums") String inpatNums,@Param("startTime") String startTime,@Param("endTime") String endTime);
	List<Map<String,String>> selectPrintItemDate2(@Param("type") String type,@Param("itemClassId") String itemClassId,@Param("inpatNums") String inpatNums,@Param("startTime") String startTime,@Param("endTime") String endTime);

	List<Map<String,String>> selectPrint(@Param("type") String type,@Param("inpatNum") String inpatNum,@Param("deptId") String deptId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("inpatorderdataId") String inpatorderdataId);
	List<Map<String,String>> selectPrint1(@Param("type") String type,@Param("inpatNums") String inpatNums,@Param("deptId") String deptId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("inpatorderdataId") String inpatorderdataId);

	List<String> getAllDeptGroup();

	String selectOrderBedNo(@Param("inpatNum") String inpatNum);

	Map<String, String> getPatientInfo(@Param("inpatNum") String inpatNum);

	List<AtomizeMedReturnEntity> queryAtomizeMedReturnByQrCode(@Param("qrCode") String qrCode);

	Map<String,String> selectInfusionTime(@Param("inpatorderdataId") String inpatorderdataId,@Param("qrCode") String qrCode);

	Map<String,String> selectInjectionTime1(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectInjectionTime2(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectInjectionTime3(@Param("inpatorderdataId") String inpatorderdataId,@Param("qrCode") String qrCode);
	Map<String,String> selectInjectionTime4(@Param("inpatorderdataId") String inpatorderdataId,@Param("qrCode") String qrCode);
	Map<String,String> selectTakeTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectAtomizationTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectBloodTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectNutritionTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectCollectionTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectInDeptTime(@Param("inpatorderdataId") String inpatorderdataId);
	Map<String,String> selectRotatingBedTime(@Param("inpatorderdataId") String inpatorderdataId);
	String getInpatorderdataIdBySubNo(@Param("inpatNum") String inpatNum,@Param("orderNo") String orderNo);

	Map<String,String> queryCheckTime(@Param("inpatorderdataId") String inpatorderdataId);
}
